package com.itheima.test;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import org.junit.Test;

public class JDBConnection {
	@Test
	public void JDBCTest() throws ClassNotFoundException, SQLException {
//		Class.forName("com.mysql.jdbc.Driver");
		Class.forName("com.mysql.cj.jdbc.Driver");//8.0以上版本
		String url = "jdbc:mysql://localhost:3306/upload?serverTimezone=UTC";
		String username = "root";
		String password = "123456";

		Connection conn = DriverManager.getConnection(url, username, password);
		System.out.println("连接成功");
		System.out.println(conn);
	}
}
